package com.hr.entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

@ApiModel("菜单类")
public class Menu {

  @ApiModelProperty("菜单id")
  private Integer id;
  @ApiModelProperty("菜单名")
  private String title;
  @ApiModelProperty("图标")
  private String icon;
  @ApiModelProperty("菜单类型")
  private Integer type;
  @ApiModelProperty("页面类型")
  private String openType;
  @ApiModelProperty("href")
  private String href;
  @ApiModelProperty("父菜单id")
  private Integer parentId;
  @ApiModelProperty("几级菜单")
  private Integer level;
  @ApiModelProperty("状态，0：disable，1：enable")
  private Integer status;
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @ApiModelProperty("更新时间")
  private Date updateTime;
  @ApiModelProperty("所有子菜单")
  private List<Menu> children;
  @ApiModelProperty("菜单关联的所有角色")
  private List<Role> roles;

  public Menu() {
  }

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getIcon() {
    return icon;
  }

  public void setIcon(String icon) {
    this.icon = icon;
  }

  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public String getOpenType() {
    return openType;
  }

  public void setOpenType(String openType) {
    this.openType = openType;
  }

  public String getHref() {
    return href;
  }

  public void setHref(String href) {
    this.href = href;
  }

  public Integer getParentId() {
    return parentId;
  }

  public void setParentId(Integer parentId) {
    this.parentId = parentId;
  }

  public Integer getLevel() {
    return level;
  }

  public void setLevel(Integer level) {
    this.level = level;
  }

  public Integer getStatus() {
    return status;
  }

  public void setStatus(Integer status) {
    this.status = status;
  }

  public Date getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
  }

  public List<Menu> getChildren() {
    return children;
  }

  public void setChildren(List<Menu> children) {
    this.children = children;
  }

  public List<Role> getRoles() {
    return roles;
  }

  public void setRoles(List<Role> roles) {
    this.roles = roles;
  }

  @Override
  public String toString() {
    return "Menu{" +
            "id=" + id +
            ", title='" + title + '\'' +
            ", icon='" + icon + '\'' +
            ", type=" + type +
            ", openType='" + openType + '\'' +
            ", href='" + href + '\'' +
            ", parentId=" + parentId +
            ", level=" + level +
            ", status=" + status +
            ", updateTime=" + updateTime +
            ", children=" + children +
            ", roles=" + roles +
            '}';
  }
}
